package com.example.marksixanim

/**
 * @author robert
 * @date 2017/12/25
 * 子鼠、丑牛、寅虎、卯兔、辰龙、巳蛇、午马 、未羊 、申猴、酉鸡 、戌狗 、亥猪。
 */

data class BallInfo(private val number: String, private val color: String, private val animal: String) {



    fun getColorDrawable(): Int {
        return when (color) {
            "红" -> R.drawable.bg_mark_six_ball_color_red
            "蓝" -> R.drawable.bg_mark_six_ball_color_blue
            "绿" -> R.drawable.bg_mark_six_ball_color_green
            else -> throw RuntimeException("不支持的颜色类型: ${this}")
        }
    }

    fun getAnimalDrawable(): Int {
        return when (animal) {
            "鼠" -> R.drawable.bg_mark_six_ball_animal_mouse
            "牛" -> R.drawable.bg_mark_six_ball_animal_cow
            "虎" -> R.drawable.bg_mark_six_ball_animal_tiger
            "兔" -> R.drawable.bg_mark_six_ball_animal_rabbit
            "龙" -> R.drawable.bg_mark_six_ball_animal_dragon
            "蛇" -> R.drawable.bg_mark_six_ball_animal_snake
            "马" -> R.drawable.bg_mark_six_ball_animal_horse
            "羊" -> R.drawable.bg_mark_six_ball_animal_sheep
            "猴" -> R.drawable.bg_mark_six_ball_animal_monkey
            "鸡" -> R.drawable.bg_mark_six_ball_animal_chicken
            "狗" -> R.drawable.bg_mark_six_ball_animal_dog
            "猪" -> R.drawable.bg_mark_six_ball_animal_pig
            else -> throw RuntimeException("不支持的生肖类型: ${this}")
        }
    }

    fun getNumberDrawable(): IntArray {
        when (color) {
            "红" -> return when (number) {
                "00" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number0)
                "01" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number1)
                "02" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number2)
                "03" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number3)
                "04" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number4)
                "05" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number5)
                "06" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number6)
                "07" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number7)
                "08" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number8)
                "09" -> intArrayOf(R.drawable.bg_mark_six_red_number0, R.drawable.bg_mark_six_red_number9)
                "10" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number0)
                "11" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number1)
                "12" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number2)
                "13" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number3)
                "14" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number4)
                "15" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number5)
                "16" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number6)
                "17" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number7)
                "18" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number8)
                "19" -> intArrayOf(R.drawable.bg_mark_six_red_number1, R.drawable.bg_mark_six_red_number9)
                "20" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number0)
                "21" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number1)
                "22" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number2)
                "23" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number3)
                "24" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number4)
                "25" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number5)
                "26" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number6)
                "27" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number7)
                "28" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number8)
                "29" -> intArrayOf(R.drawable.bg_mark_six_red_number2, R.drawable.bg_mark_six_red_number9)
                "30" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number0)
                "31" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number1)
                "32" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number2)
                "33" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number3)
                "34" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number4)
                "35" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number5)
                "36" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number6)
                "37" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number7)
                "38" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number8)
                "39" -> intArrayOf(R.drawable.bg_mark_six_red_number3, R.drawable.bg_mark_six_red_number9)
                "40" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number0)
                "41" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number1)
                "42" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number2)
                "43" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number3)
                "44" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number4)
                "45" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number5)
                "46" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number6)
                "47" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number7)
                "48" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number8)
                "49" -> intArrayOf(R.drawable.bg_mark_six_red_number4, R.drawable.bg_mark_six_red_number9)
                else -> {
                    throw RuntimeException("不支持的球号: ${this}")
                }
            }
            "蓝" -> return when (number) {
                "00" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number0)
                "01" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number1)
                "02" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number2)
                "03" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number3)
                "04" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number4)
                "05" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number5)
                "06" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number6)
                "07" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number7)
                "08" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number8)
                "09" -> intArrayOf(R.drawable.bg_mark_six_blue_number0, R.drawable.bg_mark_six_blue_number9)
                "10" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number0)
                "11" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number1)
                "12" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number2)
                "13" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number3)
                "14" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number4)
                "15" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number5)
                "16" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number6)
                "17" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number7)
                "18" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number8)
                "19" -> intArrayOf(R.drawable.bg_mark_six_blue_number1, R.drawable.bg_mark_six_blue_number9)
                "20" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number0)
                "21" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number1)
                "22" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number2)
                "23" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number3)
                "24" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number4)
                "25" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number5)
                "26" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number6)
                "27" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number7)
                "28" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number8)
                "29" -> intArrayOf(R.drawable.bg_mark_six_blue_number2, R.drawable.bg_mark_six_blue_number9)
                "30" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number0)
                "31" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number1)
                "32" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number2)
                "33" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number3)
                "34" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number4)
                "35" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number5)
                "36" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number6)
                "37" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number7)
                "38" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number8)
                "39" -> intArrayOf(R.drawable.bg_mark_six_blue_number3, R.drawable.bg_mark_six_blue_number9)
                "40" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number0)
                "41" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number1)
                "42" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number2)
                "43" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number3)
                "44" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number4)
                "45" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number5)
                "46" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number6)
                "47" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number7)
                "48" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number8)
                "49" -> intArrayOf(R.drawable.bg_mark_six_blue_number4, R.drawable.bg_mark_six_blue_number9)
                else -> {
                    throw RuntimeException("不支持的球号: ${this}")
                }
            }
            "绿" -> return when (number) {
                "00" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number0)
                "01" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number1)
                "02" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number2)
                "03" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number3)
                "04" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number4)
                "05" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number5)
                "06" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number6)
                "07" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number7)
                "08" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number8)
                "09" -> intArrayOf(R.drawable.bg_mark_six_green_number0, R.drawable.bg_mark_six_green_number9)
                "10" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number0)
                "11" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number1)
                "12" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number2)
                "13" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number3)
                "14" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number4)
                "15" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number5)
                "16" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number6)
                "17" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number7)
                "18" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number8)
                "19" -> intArrayOf(R.drawable.bg_mark_six_green_number1, R.drawable.bg_mark_six_green_number9)
                "20" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number0)
                "21" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number1)
                "22" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number2)
                "23" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number3)
                "24" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number4)
                "25" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number5)
                "26" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number6)
                "27" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number7)
                "28" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number8)
                "29" -> intArrayOf(R.drawable.bg_mark_six_green_number2, R.drawable.bg_mark_six_green_number9)
                "30" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number0)
                "31" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number1)
                "32" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number2)
                "33" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number3)
                "34" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number4)
                "35" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number5)
                "36" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number6)
                "37" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number7)
                "38" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number8)
                "39" -> intArrayOf(R.drawable.bg_mark_six_green_number3, R.drawable.bg_mark_six_green_number9)
                "40" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number0)
                "41" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number1)
                "42" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number2)
                "43" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number3)
                "44" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number4)
                "45" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number5)
                "46" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number6)
                "47" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number7)
                "48" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number8)
                "49" -> intArrayOf(R.drawable.bg_mark_six_green_number4, R.drawable.bg_mark_six_green_number9)
                else -> {
                    throw RuntimeException("不支持的球号: ${this}")
                }
            }
            else -> {
                throw RuntimeException("不支持的颜色类型: ${this}")
            }
        }
    }

    override fun toString(): String {
        return "BallInfo(number='$number', color='$color', animal='$animal')"
    }


}
